<!-- userEditForm.php 用于显示要更新的用户信息的表单。 -->
<!doctype html>
<html>
 <head>
  <meta charset="UTF-8">  
  <title>修改鲜花</title>
 </head>
 <body>
 <?php
   require_once('inc_admin.php');
   //连接数据库   
   connect();
   //用户id是通过GET方法提交的   
   //根据用户id从数据库中查询用户的所有信息
   $id = $_GET['id'];  
   $sql = "select * from flower where xjn_id={$id}";   
   $result = mysql_query($sql) or die('查询失败！'.mysql_error());   
   $row = mysql_fetch_assoc($result);
   //var_dump($row);   
    $xjn_title = $row['xjn_title'];  
    $xjn_place = $row['xjn_place'];
    $xjn_intro = $row['xjn_intro'];
    $xjn_adddate = $row['xjn_adddate'];
    $xjn_hint = $row['xjn_adddate'];
    $xjn_pic=UserPhotoPath.$row['xjn_pic']; 
	//将查询结果显示在表单中
 ?>

<form method="post"  action="flowerUpdate.php"  enctype="multipart/form-data">
<table align="center" border="1" width=500>
<caption>修改鲜花</caption>
<tr>
  <td width="20%">id</td>
  <td width="80%"><?php  echo $id;  ?>
  <input type="hidden" name="id" value=<?php  echo $id;  ?>>  
  </td>
</tr>
<tr>
  <td>鲜花名称</td>
  <td><input type="text" name="xjn_title" size=30  value=<?php  echo $xjn_title;  ?>></td>
</tr>
<tr>
  <td width=150>鲜花图片文件名</td>   
  <td>
  <img src='<?php  echo $xjn_pic;  ?>' width=100 height=150>
  <input type="file" name="xjn_pic">
  </td>
</tr>
<tr>
  <td>鲜花产地</td>
  <td><input type="text" name="xjn_place"  size=30 value=<?php  echo $xjn_place;  ?>></td>
</tr>

<tr>
<td width=150>鲜花简介：</td>
<td>
<textarea name="xjn_intro" cols="40" rows="5"><?php  echo $xjn_intro;  ?></textarea>
</td>
</tr>

<tr>
  <td>鲜花添加时间</td>
  <td><input type="date" name="xjn_adddate"  size=30 value=<?php  echo $xjn_adddate;  ?>></td>
</tr>

<tr>
  <td>点击量</td>
  <td><input type="text" name="xjn_hint"  size=30 value=<?php  echo $xjn_hint;  ?>></td>
</tr>

<tr>
<td width=150></td>
<td>
<input type="submit" value="更新">
<input type="reset" value="重置">
</td>
</tr>
</table>
</form>
 </body>
</html>